package com.ihunanren.taobao.module.screen;

import static com.google.common.base.Strings.isNullOrEmpty;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;

import com.alibaba.citrus.turbine.Context;
import com.alibaba.citrus.turbine.dataresolver.Param;
import com.ihunanren.webx.LoginHelper;

public class TaobaoLogin {

	@Autowired
	private HttpServletRequest request;

	public void execute(
			@Param(name = "redirect_url", defaultValue = "") String redirect_url,
			Context context) throws Exception {
		if(!isNullOrEmpty(redirect_url))
		redirect_url = LoginHelper.getRedirectUrl(request);
		
		context.put("redirect_url", redirect_url);
	}

}
